<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Files.aspx.cs" Inherits="MOM.Files" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
	<script type="text/javascript" language="javascript" src="Js/jquery-1.2.6.js"></script>
	<script type="text/javascript" language="javascript" src="Js/jquery.flydom-3.1.0.js"></script>
	<script type="text/javascript" language="javascript" src="Js/Common.js"></script>
	<script type="text/javascript" language="javascript" src="Js/KeyHandler.js"></script>
	<script type="text/javascript" language="javascript">
		$(document).ready(function() {
			$("#cbMulti").click(function() { var checked_status = this.checked; $(":checkbox").each(function() { this.checked = checked_status; }); }); 
		});	
		
		function SelectTracks(replace)
		{
			var tracks = new Array();
			$(":checkbox").each(			
				function()
				{
					if (parseInt(this.value) > -1 && this.checked)
						tracks.push(parseInt(this.value));
				}
			);
			top.MOM.PlayDirectory("<%=GetJsDirectory() %>", tracks, replace);
		}	
	</script>
	<style type="text/css">
		@import url(Css/Mom.css);
		@import url(Css/themes/<%=MOMTheme %>.css);
	</style>
</head>
<body class="Iframe">
<form id="Form1" runat="server">
<div class="FilesCrumbs"><%#DirectoryCrumbs %></div>

<div class="DropShadow" style="margin-right:20px;">
	<div class="Box">
		<div class="P10">
			<table cellpadding="0" cellspacing="0" class="Files">
				<tbody>
					<asp:Repeater ID="rptDir" OnItemDataBound="Dir_DataBound" EnableViewState="true" runat="server">
						<HeaderTemplate><asp:LinkButton ID="lbParent" Text=".." CommandArgument='<%#ParentDirectory %>' OnClick="Dir_Click" runat="server"></asp:LinkButton></HeaderTemplate>
						<ItemTemplate>
						<tr onmouseover="Hover(this)" onmouseout="Hover(this)">
							<td><img src="Images/<%=MOMTheme %>/folder.gif" /></td>
							<td colspan="2"><asp:LinkButton id="lbDir" Text='<%#GetDirectoryName((string)Container.DataItem) %>' CommandArgument='<%#(string)Container.DataItem %>' OnClick="Dir_Click" runat="server"></asp:LinkButton></td>
						</tr>
						</ItemTemplate>
					</asp:Repeater>
					<asp:Repeater ID="rptTrack" runat="server">
						<HeaderTemplate>
							<tr><td colspan="3" align="right"><input type="checkbox" id="cbMulti" value="-1" checked="checked" /></td></tr>
						</HeaderTemplate>
						<ItemTemplate>
						<tr onmouseover="Hover(this)" onmouseout="Hover(this)">
							<td><img src="Images/<%=MOMTheme %>/file.gif" /></td>
							<td><%#GetFileName((string)Container.DataItem) %></td>
							<td style="padding-left:10px;"><input type="checkbox" id="cbSelect" checked="checked" value='<%#Container.ItemIndex %>' runat="server" /></td>
						</tr>
						</ItemTemplate>
					</asp:Repeater>
				</tbody>
			</table>
			
		    <div class="ButtonRow">
			    <a href="javascript:SelectTracks(false)" class="Button"><%=Translate("queueselected") %></a>
			    <a href="javascript:SelectTracks(true)" class="Button"><%=Translate("playselected") %></a>
		    </div>													
	
		</div>
	</div>
</div>
</form>
</body></html>